package com.shz.appletsapi;

import java.util.HashMap;
import java.util.Map;

import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableAsync
@EnableScheduling
public class ApiApplication {

	public static void main(String[] args) {
		SpringApplication.run(ApiApplication.class, args);
	}

	@Bean
	public Queue queue() {
		Map<String, Object> args = new HashMap<String, Object>();
		args.put("x-max-length", 500000); // 
		args.put("x-max-length-bytes", 1024*1024*20);
		Queue q = new Queue("lahuo.monitor",true,false,false,args);
		return q;
	}

}
